<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

/**
 * Class CreateRatingCategoriesTable.
 */
class CreateRatingCategoriesTable extends Migration
{
	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('rating_categories', function (Blueprint $table) {
			$table->increments('id');
			$table->string('category_name')->comment('评分大类名称');
			$table->integer('total_score')->comment('总分');
			$table->timestamps();
		});
		$sql = <<<SQL
		INSERT INTO rating_categories (category_name, total_score) VALUES
('安全管理', 40),
('公共设施管理', 30),
('文明卫生管理', 30);
SQL;
		DB::statement($sql);
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('rating_categories');
	}
}
